package org.seanye.erp.view.editor;

import java.io.File;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

public class WeekFileInput implements IEditorInput {

    public final File diskFile;

    public WeekFileInput(final File diskFile) {
	this.diskFile = diskFile;
    }

    public File getDiskFile() {
	return diskFile;
    }

    public boolean exists() {
	return this.diskFile.exists();
    }

    public ImageDescriptor getImageDescriptor() {
	Image image = PlatformUI.getWorkbench().getSharedImages().getImage(
		ISharedImages.IMG_OBJ_FILE);
	return ImageDescriptor.createFromImage(image);
    }

    public String getName() {
	return diskFile.getName();
    }

    public IPersistableElement getPersistable() {
	return null;
    }

    public String getToolTipText() {
	return diskFile.getAbsolutePath();
    }

    @SuppressWarnings("unchecked")
    public Object getAdapter(Class adapter) {
	return null;
    }

}
